package com.basic;

import com.frame.struts.BaseBean;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.beanutils.ConvertUtils;

import com.frame.struts.ActionContext;
import com.utils.*;

import java.util.Date;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class RegFundChangeForm extends BaseBean {
    public RegFundChangeForm() {
    }
    
    static{
        ConvertUtils.register(new DateConverter(), Date.class);
    }
    
	RegFundChangeEntity rfce = new RegFundChangeEntity();
	private String oldId="";
	public String addRegFundChange(){
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		rfce.setQyid(qyid);
		rfce.setOptdate(new Date());
		rfce.setOptrid(CommUtil.getUserId(request));
		rfce.setXh(factory.getNextXh("qy_zczbbg", qyid));
		try{
		if(factory.addRegFundChange(rfce)){
			    response.sendRedirect("/basic/queryRegFundMove.jsp");
		}
		else{
		response.sendRedirect("/basic/failed.jsp");
		}
		}
		catch (Exception e) {

		}

		return null;
	}
	public String modifyRegFundChange(){
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		rfce.setQyid(qyid);
		rfce.setOptdate(new Date());
		rfce.setOptrid(CommUtil.getUserId(request));
		rfce.setXh(factory.getNextXh("qy_zczbbg", qyid));
		factory.deleteRegFundChange(rfce.getQyid(),Integer.parseInt(this.getOldId().trim()));
		try{
			if(factory.addRegFundChange(rfce)){
			    response.sendRedirect("/basic/queryRegFundMove.jsp");
		    }
			else
			{
				response.sendRedirect("/basic/failed.jsp");
			}
		}
		catch (Exception e) {

		}
			return null;
	}
	public String getOldId(){
		return this.oldId;
	}
	public void setOldId(String oldId){
		this.oldId=oldId;
	}

	/**
	 * @return rfce.getReturns the czfs.
	 */
	public String getCzfs() {
		return rfce.getCzfs();
	}
	/**
	 * @param czfs The czfs to set.
	 */
	public void setCzfs(String czfs) {
		rfce.setCzfs(czfs);
	}
	/**
	 * @return rfce.getReturns the optdate.
	 */
	public Date getOptdate() {
		return rfce.getOptdate();
	}
	/**
	 * @param optdate The optdate to set.
	 */
	public void setOptdate(Date optdate) {
		rfce.setOptdate(optdate);
	}
	/**
	 * @return rfce.getReturns the optrid.
	 */
	public String getOptrid() {
		return rfce.getOptrid();
	}
	/**
	 * @param optrid The optrid to set.
	 */
	public void setOptrid(String optrid) {
		rfce.setOptrid(optrid);
	}
	/**
	 * @return rfce.getReturns the qyid.
	 */
	public String getQyid() {
		return rfce.getQyid();
	}
	/**
	 * @param qyid The qyid to set.
	 */
	public void setQyid(String qyid) {
		rfce.setQyid(qyid);
	}
	/**
	 * @return rfce.getReturns the recstate.
	 */
	public String getRecstate() {
		return rfce.getRecstate();
	}
	/**
	 * @param recstate The recstate to set.
	 */
	public void setRecstate(String recstate) {
		rfce.setRecstate(recstate);
	}
	/**
	 * @return rfce.getReturns the remark.
	 */
	public String getRemark() {
		return rfce.getRemark();
	}
	/**
	 * @param remark The remark to set.
	 */
	public void setRemark(String remark) {
		rfce.setRemark(remark);
	}
	/**
	 * @return rfce.getReturns the xh.
	 */
	public int getXh() {
		return rfce.getXh();
	}
	/**
	 * @param xh The xh to set.
	 */
	public void setXh(int xh) {
		rfce.setXh(xh);
	}
	/**
	 * @return rfce.getReturns the yzczb.
	 */
	public double getYzczb() {
		return rfce.getYzczb();
	}
	/**
	 * @param yzczb The yzczb to set.
	 */
	public void setYzczb(double yzczb) {
		rfce.setYzczb(yzczb);
	}
	/**
	 * @return rfce.getReturns the zze.
	 */
	public double getZze() {
		return rfce.getZze();
	}
	/**
	 * @param zze The zze to set.
	 */
	public void setZze(double zze) {
		rfce.setZze(zze);
	}
	/**
	 * @return rfce.getReturns the zzhzczb.
	 */
	public double getZzhzczb() {
		return rfce.getZzhzczb();
	}
	/**
	 * @param zzhzczb The zzhzczb to set.
	 */
	public void setZzhzczb(double zzhzczb) {
		rfce.setZzhzczb(zzhzczb);
	}
	/**
	 * @return rfce.getReturns the zzsj.
	 */
	public java.sql.Date getZzsj() {
		return rfce.getZzsj();
	}
	/**
	 * @param zzsj The zzsj to set.
	 */
	public void setZzsj(java.sql.Date zzsj) {
		rfce.setZzsj(zzsj);
	}
	public java.sql.Date getJzsj() {
		return rfce.getJzsj();
	}
	public void setJzsj(java.sql.Date jzsj) {
		rfce.setJzsj(jzsj);
	}
	public double getJze() {
		return rfce.getJze();
	}
	public void setJze(double jze) {
		rfce.setJze(jze);
	}
	public String getJzjgmc() {
		return rfce.getJzjgmc();
	}
	public void setJzjgmc(String jzjgmc) {
		rfce.setJzjgmc(jzjgmc);
	}

}